import website  from '@/framework-core/config/website';
import {validateRules} from "@/framework-core/utils/validateRule";

export const tableOption = {
    "border": true,
    "index": true,
    "indexLabel": "#",
    "stripe": true,
    "menuAlign": "center",
    "align": "center",
    "searchMenuSpan": 6,

    searchEnter: true,
    selection: true,
    grid: window.isMobile,
    addBtn: false,
    editBtn: false,
    gridSpan: 24,
    menuWidth: 340,
    "column": [


        {
            "type": "number",
            "label": "模板",
            "prop": "templateId",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '模板不能为空',
                trigger: 'blur'
            }],
            'search': false,
            hide: true,
            "span": 12
        }

        ,
        {
            "type": "input",
            "label": "标题",
            "prop": "title",
            "overHidden": false,

            "rules": [{
                required: true,
                message: '标题不能为空',
                trigger: 'blur'
            }],
            'search': true,
            "span": 12
        }


        ,
        {
            "type": "input",
            "label": "公章名称",
            "prop": "secretLevel",
            "overHidden": false,


            "rules": [{
                required: true,
                message: '公章名称不能为空',
                trigger: 'blur'
            }],
            'search': false,
            hide: true,
            "span": 12
        }

        ,
        {
            "type": "input",
            "label": "发文部门",
            "prop": "company",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '发文部门不能为空',
                trigger: 'blur'
            }],
            'search': true,
            "span": 12
        }

        ,
        {
            "type": "input",
            "label": "年份",
            "prop": "year",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '年份不能为空',
                trigger: 'blur'
            }],
            'search': true,
            "span": 12
        }

        ,
        {
            "type": "input",
            "label": "第几号文",
            "prop": "num",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '第几号文不能为空',
                trigger: 'blur'
            }],
            'search': false,
            "span": 12
        }

        ,
        {
            "type": "input",
            "label": "企字",
            "prop": "qizi",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '企字不能为空',
                trigger: 'blur'
            }],
            'search': false,
            "span": 12
        }

        ,
        {
            "type": "input",
            "label": "文件地址",
            "prop": "url",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '文件地址不能为空',
                trigger: 'blur'
            }],
            'search': false,
            hide: true,
            "span": 12
        }

        , {
            label: "图片",
            prop: "img",
            listType: 'picture-img',
            type: "upload",
            "minWidth": "120px",
            hide: true,
            addDisplay: false,
            editDisplay: false
        },

        {
            "type": "upload",
            "label": "图片",
            "prop": "img",
            "overHidden": false,
            hide: true,
            listType: 'picture-img',
            propsHttp: {
                url: 'url',
                name: 'name',
                res: 'data.data'
            },
            limit: 1,
            loadText: '图片上传中，请稍等',
            canvasOption: {
                text: "",
                ratio: 0.1,
            },
            accept: 'image/png, image/jpeg',
            cropperOption: {
                autoCropWidth: 100,
                autoCropHeight: 100,
                fixed: true,
                fixedNumber: [100, 100],
            },
            tip: '只能上传jpg/png文件，且不超过500kb',
            action: website.baseUrl + "/api/sys/file/upload",
            "rules": [{
                required: false,
                message: '图片不能为空',
                trigger: 'blur'
            }],
            'search': false,
            "span": 24
        }
        ,
        {
            "type": "input",
            "label": "保密期间",
            "prop": "secretPeriod",
            dicCode: "secretLevels",
            "overHidden": false,
            "rules": [{
                required: true,
                message: '保密期间不能为空',
                trigger: 'blur'
            }],
            'search': false,
            "span": 12
        }

        ,
        {
            "type": "select",
            "label": "紧急程度",
            "prop": "emergentLevel",
            "overHidden": false,
            dicCode: "ao_urgency",
            "rules": [{
                required: true,
                message: '紧急程度不能为空',
                trigger: 'blur'
            }],
            'search': true,
            "span": 12
        }
        ,
        {
            "type": "date",
            "label": "发文日期",
            "prop": "sendDate",
            "overHidden": false,
            format: 'YYYY/MM/DD ',
            valueFormat: 'YYYY-MM-DD',
            "rules": [{
                required: true,
                message: '发文日期不能为空',
                trigger: 'blur'
            }],
            'search': false,
            "span": 12
        }

        // ,
        // {
        //     "type": "select",
        //     "label": "发文状态",
        //     "prop": "sendStatus",
        //     "overHidden": false,
        //     dicCode: "oaDocStatus",
        //     "rules": [{
        //         required: true,
        //         message: '发文状态不能为空',
        //         trigger: 'blur'
        //     }],
        //     'search': true,
        //     "span": 12
        // }
        ,
        {
            "type": "input",
            "label": "公文内容",
            "prop": "content",
            "overHidden": false,
            "rules": [{
                required:true,
                message: '公文内容不能为空',
                trigger: 'blur'
            }],
            'search':  false,
            hide:true,
            "span": 12
        }
    ]
}
